home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / Infinity Windoid 3.0 / Documentation < prev    next >
Text File  |  1995-02-20  |  17KB  |  212 lines

  1. Infinity Windoid WDEF Documentation
  2.  
  3. by Troy Gaul
  4. Infinity Systems
  5.  
  6. The Infinity Windoid WDEF is © 1991-95 Infinity Systems. All rights reserved.
  7.  
  8.  
  9. I M P O R T A N T    N O T E S
  10.  
  11. If you will be compiling your own version of the Infinity Windoid, or even just using it in a program, do not set the purgeable bit of the WDEF resource.  Doing so is known to cause problems in certain situations (it seems to be more prominent with System 7.5 than it has been in the past). If you have an application that already uses the Infinity Windoid, check it for this problem (some project files included in previous distributions of the WDEF may have had this bit set).
  12.  
  13. The variation codes used by the Infinity Windoid by default (the compiled version that are included) are now different. Any windows that use a previous version of the Infinity Windoid WDEF will have to have its procID changed slightly. It now uses the same variation codes as Apple’s System 7.5 floating window WDEF. In particular, add 4 to the procID to get a zoom box (instead of 8 as in the past); add 2 to get a grow box (instead of using 4 to prohibit a grow box); always add 1 (to make sure that the WDEF will dim when it’s window’s hilited flag is not on) unless you expressly want the “always hilight” behavior, and finally, add 8 if you want the titlebar down the left side (instead of 2 as in the past). See the file “InfinityWindoid.h” for a new set of useful constants.
  14.  
  15.  
  16. R E G I S T E R I N G    T H E    I N F I N I T Y    W I N D O I D    W D E F
  17.  
  18. You can register your copy of the Infinty Windoid WDEF. Doing so is free and requires only a message sent to me with information about you (and your company if you are connected to one).
  19.  
  20. I will then add you to my list of registered users, and you will receive notification of future versions and beta testing opportunities. Make sure to include an e-mail address (Internet, AppleLink, America Online, or any other service with an Internet gateway).
  21.  
  22. You can find the latest version of the Infinity Windoid on the Internet in the Info-Mac archives at sumex.stanford.edu (there are also several mirror sites that are usually much more accessable).  I also try to keep the Mac developer forum on AOL up to date.
  23.  
  24. Troy Gaul
  25. Infinity Systems
  26. 8500 148th Ave. N.E. #CC1101
  27. Redmond, WA 98052
  28.  
  29. Internet:  tgaul@halcyon.com        (preferred)
  30. America Online:  TGaul
  31. eWorld:  TGaul
  32.  
  33.  
  34. S Y S T E M   7 . 5   F L O A T I N G   W I N D O W   W D E F
  35.  
  36. With System 7.5 and later Systems, a new WDEF is included. This WDEF can be seen on the Apple Guide windows. Apparently, Apple was encouraging developers to use this WDEF for their own floating windows at the Worldwide Developers Conference (I heard this was the case — I was unable to attend myself).
  37.  
  38. The ID of the 7.5 windoid WDEF resource is 124. Apple employees have said that by using this WDEF ID when the System version is 7.5 or later, your application will automatically get any changes that are made to this WDEF in future Systems. 
  39.  
  40. Also, in a future System version, Apple will be rewriting the Window Manager, and it apparently will no longer use WDEFs as its means of customization (actually, WDEFs will probably have to be supported for backward compatibility with older applications that include them internally). This may allow the user to change the look of the windows in a System-wide fashion. Windows using the procID that defines the 7.5 windoid WDEF will be automatically compatible with window appearances in future System releases. It has been said that the new Window Manager will also support floating and modal windows directly.
  41.  
  42.  
  43. INFINITY WINDOID SUPPORT:
  44.  
  45. While I’m was exactly a fan of the graphic design of this new WDEF at first, it has grown on me, and I thought that it was important for me to support it in the Infinity Windoid. Version 3.0 supports it in several ways. 
  46.  
  47. First, there is a compiler flag that causes any version of the Infinity Windoid (that is, any appearance) to support the variation codes used by the new Apple WDEF. This is now the default. This means that you can use the Infinity Windoid with the same varcode for the same behavior (only changing the WDEF ID depending upon the System version). 
  48.  
  49. The second flag lets you create a WDEF with the same appearance as the System 7.5 WDEF. 
  50.  
  51. To simplify using these two flags, there is another flag that will cause both things to happen (actually, it just causes the other two flags to be defined).
  52.  
  53. Finally, there is a flag that will compile a version of the Infinity Windoid that acts and looks like the 7.5 WDEF on System version eariler than 7.5 (i.e. 6.x, 7.0, 7.0.1, 7.1), but if 7.5 is present it will instead call through to the built-in System-supplied WDEF.
  54.  
  55. Starting with version 3.0 of the Infinity Windoid, the default compiler flags for the WDEF cause it to use the same variation codes as the Apple WDEF, as these should become the standard.
  56.  
  57.  
  58. USING THE SYSTEM 7.5 FLOATER WDEF:
  59.  
  60. In order to use the System 7.5 floater WDEF, first make sure the user is running System 7.5.  It isn't available in eariler System versions — Apple has said that they will release a ‘compatibility’ WDEF that you will be able to include in your App that will call through to the System floater WDEF if it is present (like the Movable Modal WDEF they released for compatibility with System 6). They haven’t released this yet, though, so instead, you can include the Infinity Windoid and use it if the System version is earlier than 7.5.
  61.  
  62. Second, call NewWindow:
  63.  
  64. wind = NewWindow(nil, &rBounds, title, visFlag, wDefProcID, behind, goAwayFlag, refCon);
  65.  
  66. (One side note about NewWindow, NewDialog, etc: Apple has indicated that you should call them with nil as the storage paramater to allow the System to allocate memory for the window — instead of allocating it yourself.  The reason for this involves changes that will be made to the Window Manager in the future.)
  67.  
  68. For the wDefProcID, pass in one of:
  69.  
  70. /* floating window defproc ids */
  71.     floatProc              = 1985,
  72.     floatGrowProc          = 1987,
  73.     floatZoomProc          = 1989,
  74.     floatZoomGrowProc      = 1991,
  75.     floatSideProc          = 1993,
  76.     floatSideGrowProc      = 1995,
  77.     floatSideZoomProc      = 1997,
  78.     floatSideZoomGrowProc  = 1999,
  79.  
  80. These definitions are found in Windows.h in the new set of Universal Headers (known as version 2.0) that were included for the first time on ETO 15.  If you aren’t using these headers, you might want to make these definitions for yourself for now.
  81.  
  82. If the System version is earlier than 7.5, use one of the following constants from InfinityWindoid.h instead (and don’t forget to include the WDEF from the file “I.W./68K/Apple 7.5 design” that is included in this package in your application):
  83.     kInfinityProc
  84.     kInfinityGrowProc
  85.     kInfinityZoomProc
  86.     kInfinityZoomGrowProc
  87.     kInfinitySideProc
  88.     kInfinitySideGrowProc
  89.     kInfinitySideZoomProc
  90.     kInfinitySideZoomGrowProc
  91.  
  92. Also, if you pass in a non-empty string in ‘title’, it will be displayed in Geneva 9 plain (assuming the titlebar is across the top).
  93.  
  94.  
  95. NOTES ABOUT FLOATER WDEF FROM 7.5:
  96.  
  97. There are a couple idiosyncacies with the floating window WDEF that was shipped with the System 7.5 release.
  98.  
  99. The grow box is one pixel narrower than the standard grow box, which means that a scroll bar will look strange when sized to match it, and the grow box doesn't dim when the rest of the windoid dims.  
  100.  
  101. Also, the titlebar flashes more than it needs to when being redrawn, and there is a minor problem with multiple monitors (it is possible with the right monitor configuration that the WDEF will always draw in black and white, even if it is partly or entirely on a color monitor).
  102.  
  103.  
  104. M A K I N G    W I N D O W S    F L O A T
  105.  
  106. While the Infinity Windoid WDEF is designed to be used for floating windows (which are sometimes known as utility windows, tool windows, windoids, or floaters), the Infinity Windoid WDEF does not help you to make your windows float above document windows.
  107.  
  108. There are no routines built into the high level Window Manager to support making windows float. Only by using the low level routines in the Window Manager is it possible to create code which will support floating windows. In the future (rumor has it, the Copland system release) the MacOS will directly support floating and modal windows.
  109.  
  110. The logistics of making a set of windoids float in a layer above other windows are fairly complicated, so I will not go into them here. In issue 15 of Develop magazine, there is an article that provides these details. This article also presents a library of code that can be used to create floating windows. 
  111.  
  112. There are also a few other libraries of code available that create floating windows. These have varying levels of polish, and can be found at the standard archive sites like info-mac on sumex-aim.stanford.edu and America Online.
  113.  
  114. In order to get a copy of issue 15 of Develop, you can contact Develop at:
  115.  
  116. Develop
  117. Apple Computer, Inc.
  118. P.O. Box 531
  119. Mount Morris, IL 61054-7858
  120. 1-800-877-5548 in the U.S.
  121. (815) 734-1116 in all other countries
  122. (815) 734-1127 FAX
  123.  
  124. You can get a printed back issue of issue 15 for $13 in the U.S. ($20 elsewhere). It is my understanding that a back issue such as this will come with the latest version of the CD-ROM, so you will get any changes that have been made since the original article was published (there were newer versions released with issues 16, 18, and 20 of Develop, for example).
  125.  
  126. You can also get a one year (four issue) subscription for $30 in the U.S. ($50 elsewhere). Each issue includes a CD-ROM that contains all of the back issues of Develop and code for each issue. Most issues are available in Apple DocViewer format, so you could subscribe and you’d get the issue 15 article on the CD-ROM with your first issue.
  127.  
  128.  
  129. C O N D I T I O N S    F O R    U S E
  130.  
  131. I hereby grant users of the Infinity Windoid WDEF permission to use a WDEF created by it (or any modified version of it) in applications (or any other type of Macintosh software like extensions -- freeware, shareware, commercial, or other) for free, subject to the terms that:
  132.  
  133.    (1)  This agreement is non-exclusive.
  134.  
  135.    (2)  I, Troy Gaul, retain the copyright to the original source code.
  136.  
  137.  
  138. These two items are the only required conditions for use of the WDEF. However, I do have a few additional requests. Note, however, that these are only requests, and that they are not required conditions for use of a Windoid WDEF created by this code.
  139.  
  140.    (1)  That I be given credit for the Infinity Windoid WDEF in the copyrights or acknowledgements section of your manual or other appropriate documentation.
  141.  
  142.    (2)  That the name of the WDEF resource remains "Infinity Windoid x.x" (where x.x is replaced by the current version of the Infinity Windoid).
  143.  
  144.    (3)  That you send me the name of any package that the WDEF is used within, and that I be granted permission to use this information in a list of applications using the Infinity Windoid WDEF.
  145.  
  146.    (4)  That I receive a complimentary copy of the application in which it is used. For a commercial application, this means that I get the full package that can be registered. For a shareware application, this means I get a registered copy of the application. For an in-house application (or something similar), this item does not apply.
  147.  
  148.  
  149. I would like to repeat that these last items are only requests. You are prefectly free to choose not to do any or all of them. I do not believe they should be unreasonable to anyone, but I would rather have people not do these things than not use my Windoid WDEF or bother taking the time to write one like it when that is unnecessary.
  150.  
  151. My goal in writing this WDEF and in releasing it to the public is to get it used in as many places as possible. There should no longer be any reason for a program to use an old-style black-and-white Windoid WDEF.
  152.  
  153.  
  154. A B O U T    O T H E R    V E R S I O N S
  155.  
  156. In the past, there have been other version of the Infinity Windoid WDEF included with the package. In an effort to further standardize the appearance of floating windows using the Infinity Windoid WDEF, I have removed these. 
  157.  
  158. Instead, you should choose a procID from the set in InfinityWindoid.h to achieve the features you desire from the WDEF. For existing applications, this may mean editing either your code or resources to use the new set of variation codes.
  159.  
  160. If you really need to compile a version of the WDEF without certain features compiled in (e.g for a very small footprint in memory), or to compile a backward compatible version of the WDEF (e.g. because you don’t have access to the source or resources used to define the windows the WDEF is used for), there are still a number of options that can be set in WindoidDefines.h to let you accomplish this with a minimum of effort.
  161.  
  162.  
  163. A P P L I C A T I O N S    U S I N G    T H E    I N F I N I T Y    W I N D O I D
  164.  
  165. Since the release of version 2.2 of the Infinity Windoid WDEF, several authors of freeware, shareware, and commercial applications have begun to use it in their packages. Some of the packages where the Infinity Windoid can be seen include:
  166.     
  167. • Cinemaina ’95, by Microsoft — a CD-ROM-based guide to movies and moviemakers
  168. • Code Warrior, by Metrowerks (including each of the compilers and the debugger).
  169. • Color It!, Enhance, and Paint It!, by MicroFrontier, Inc.
  170. • Desktop Strip, by Men & Mice — a shareware utility to run Control Strip modules on desktop Macs.
  171. • DragStrip, by Natural Intelligence — a utility for creating icon strips for launching and dragging.
  172. • Finder Pals, by Robert Mah — a Ziffnet utility that adds floating windows to the Finder.
  173. • GURU, by Craig Marciniak — GUide to RAM Upgrades, a free memory checking and information utility sponsored by Newer Technology.
  174. • HoverBar, by Guy Fullerton — a shareware program that provides floating icon strips.
  175. • JPEGView 3.x, by Aaron Giles — a freeware JPEG/GIF/etc. image viewer and slide show program.
  176. • Malph, by Nitin Ganatra — a freeware "drag-happy process switcher/launcher".
  177. • MetaFlo, by The Valis Group — an image distortion utility.
  178. • Newton Developer Toolkit, by Apple Computer, Inc.
  179. • PowerDock and ToolBar library, by Narayan Sainaney.
  180. • PowerScan 2.0, by Jonas Wallden — a shareware file scanning utility.
  181. • RPG Tools, by BadgerCom — a role-playing game utility.
  182. • SITcomm, by Aladdin Systems — a terminal emulation program.
  183. • Sparkle, by Maynard Handley — a freeware MPEG movie viewer and converter.
  184. • SquareOne 2.0, by Binary Software — an icon-dock utility.
  185. • VistaPro, by Virtual Reality Labs — a terrain image generator.
  186. • Visual C++ for Macintosh, by Microsoft — a Windows NT-based cross compiler (the WDEF is included with a library of code for Macintosh users).
  187. • Warlords II, by Strategic Studies Group — an adventure game.
  188. • and many more...
  189.  
  190.  
  191. A C K N O W L E D G E M E N T S
  192.  
  193. In the course of creating and distributing this Windoid WDEF, it has been more than a singular effort. There are several other people who deserve recognition of their part:
  194.  
  195. Tom Pinkerton, who wrote a windoid WDEF from which I created this one and who, basically, taught me how to program the Macintosh.
  196.  
  197. Richard Harms, who kept pushing me to add features (such as the System 6 color support, support for 68000 machines, and the MacApp-style). He also told me about the bugs he found, and prodded me to release the first version to the public. 
  198.  
  199. Jim Petrick, who sent me his modified version of the WDEF upon which version 2.5’s support for a grow box was based. Also, he diagnosed and corrected a problem with the way 2.3 handled custom window color tables, and his version inspired some of the changes made to simplify the code.
  200.  
  201. Aaron Giles, who has given me a lot of help in getting the Infinity Windoid WDEF to compile into a Fat binary and PowerPC only version using Apple's development environment.
  202.  
  203. Also, the book Macintosh Programming Secrets by Scott Knaster and Keith Rollin provided a couple routines (for example, SyncPorts) that helped to make the code more robust.
  204.  
  205. Thanks to MicroFrontier for letting me release this WDEF (which was originally written for Color It!) for use by others.
  206.  
  207. I’d like to thank all of those people who have registered the Infinity Windoid WDEF. Several of these people have also helped me to beta test new versions. This has helped to assure me that the latest version is the best, most stable one yet.
  208.  
  209. Finally, I need to acknowledge those people and companies who have decided to use the Infinity Windoid WDEF. It is this reason for which I released this WDEF to the public in the first place, and I am glad I can help to provide a more attractive, consistent interface for users of these products.
  210.  
  211.  
  212.